﻿-- =============================================
-- Author:		Sandy Stewart
-- Create date: 02/07/2011
-- Description:	Remove links for a particular parliamentarian.
--				Does not delete rows from the ParliamentarianWebLinks
--				table.
-- =============================================
CREATE PROCEDURE DeleteParliamentarianLink 
	@CPALId int
AS
BEGIN
	SET NOCOUNT ON;

	IF (SELECT COUNT(*) FROM ParliamentarianWebLinks WHERE CPALId = @CPALId) > 0
		BEGIN
			-- Update ParliamentarianWebLinks table
			UPDATE ParliamentarianWebLinks
			SET PartyWebsite = null,
				PersonalWebsite = null,
				FacebookAddress = null,
				TwitterAddress = null
			WHERE CPALId = @CPALId
		END	
END